{include file="public/layout" /}
{include file="gzh/header" /}

<body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
{include file="canal/left" /}
<div class="page min-hg-c-10" style="min-width:auto;margin-left:100px;">

    <div class="fixed-bar">
        <div class="item-title">
            <a class="back_xin" href="{:url('Gzh/index')}" title="返回"><i class="iconfont e-fanhui"></i></a>
            <div class="subject">
                <h3>新增素材</h3>
                <h5></h5>
            </div>
        </div>
    </div>    
    <form class="form-horizontal" id="post_form" action="" method="post" enctype="multipart/form-data">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="title"><em>*</em>素材类型</label>
                </dt>
                <dd class="opt"> 
                    <label><input type="radio" name="type" value="text" checked=true> 文本</label>&nbsp;
                    <label><input type="radio" name="type" value="pic"> 图文</label>&nbsp;
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row dl_row" id="dl_text">
                <dt class="tit">
                    <label for="text"><em>*</em>文本内容</label>
                </dt>
                <dd class="opt ui-text">
                    <textarea rows="5" cols="80" id="text" name="text" style="height:200px;" placeholder="" class="ui-input" data-num="600">{$field.text|default=''}</textarea>
                    <p class="notic">（<span class="ui-textTips">还可以输入600个字</span>）</p>
                </dd>
            </dl>
            <dl class="row dl_row" id="dl_pic">
                <dt class="tit">
                    <label><em>*</em>选择图文</label>
                </dt>
                <dd class="opt">
                    <a href="JavaScript:void(0);" data-href="/test/login.php?m=admin&amp;c=ShopComment&amp;a=comment_goods_list&amp;lang=cn" onclick="openFullframe(this, '选择商品', '80%', '80%');" class="ncap-btn ncap-btn-green">选择图文</a>
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <div class="bot mt30">
                <a href="JavaScript:void(0);" onclick="formSubmit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">保存</a>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript" src="__SKIN__/js/clipboard.min.js"></script>
<script type="text/javascript">
    $(document).ready(function() {  
        $('input[type="radio"][name="type"]').change(function() {  
            var value = $(this).val();  
            var $dlToShow = $('#dl_' + value); // 获取当前需要显示的dl元素  
              
            // 隐藏所有dl元素  
            $('.dl_row').hide();  
              
            // 显示当前需要显示的dl元素  
            $dlToShow.show();  
        });  
          
        // 初始化时，如果有默认值被选中，也执行一次change事件的处理逻辑  
        $('input[type="radio"][name="type"]:checked').trigger('change');  
    });  
    function showtext(classname){
        var clipboard1 = new Clipboard("."+classname);clipboard1.on("success", function(e) {layer.msg("复制成功");});clipboard1.on("error", function(e) {layer.msg("复制失败！请手动复制", {icon:2});}); 
    }
</script>
{include file="public/footer" /}